<!--
 - Author : wang885298.
 - Date   : 2019/4/4.
 - File   : view.预览
 -->

<template>
  <div class="viewWrap">
    <transition name="el-zoom-in-center">
      <buildMsg class="demoHtml" v-if="showDemoHtml" :info="info" @closeBuild="closeHtml"></buildMsg>
    </transition>
  </div>
</template>

<script>
  import buildMsg from '@/components/buildingMsg'
  export default {
    data() {
      return {
        showDemoHtml: false,
        state: '0',
        guanLianMdzj: this.$route.query.pointId || window.localStorage.getItem('pointId'),
        currentPage: 1,
        totalCount: 1,
        pageSize: 10,
        info: {}
      }
    },
    components: {
      buildMsg
    },
    mounted() {
      this.init()
    },
    methods: {
      init() {
        this.buildingInfoListInit(this.currentPage)
      },
      closeHtml () {
        this.showDemoHtml = false
      },
      /**
       * 初始化楼栋信息
       * @author wang885298
       * @createTime 2019/04/03
       */
      buildingInfoListInit (currentPage) {
        var params = {
          guanLianMdzj: this.guanLianMdzj,
          page: currentPage,
          pageSize: this.pageSize
        }
        this.$request.louDongGLListGet(params)
          .then(res => {
            console.log(res, 'getLoudongList')
            this.state = res.countResultMap.isGl
            if (this.state === '0') {
              this.$alert('当前锚点尚未关联任何内容！', '提示', {
                confirmButtonText: '确定',
                callback: action => {
                  // this.$router.push({path: '/relate', query: {guanLianMdzj: this.guanLianMdzj}})
                }
              })
            } else {
              this.totalCount = res.totalCount
              this.info = res.recordList[0]
              this.showDemoHtml = true
            }
          })
          .catch(error => {
            console.log(error)
          })
      }
    }
  }
</script>

<style ref="stylesheet/lesss" lang="less">
  .demoHtml{
    position: absolute;
    left: 100px;
    top: 200px;
    //统一滚动条样式
      ::-webkit-scrollbar {/*滚动条整体样式*/
        width: 7px;     /*高宽分别对应横竖滚动条的尺寸*/
        height: 7px;
      }
    ::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
      border-radius: 5px;
      -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0);
      background: #1975b3;
    }
    ::-webkit-scrollbar-track {/*滚动条里面轨道*/
      -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0);
      border-radius: 0;
      background: rgba(0,0,0,0);
    }
  }
</style>
